<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class City_mdl extends CI_Model
{
	public function __construct()
	{
		parent::__construct();
	}
	
	public function getCityList()
	{
		$arrRet = array();
		$strSql = 'SELECT * FROM  dili_u_c_city';
		$arr    = $this->db->query($strSql)->result_array();
		
		foreach ($arr as $index => $arr2)
		{
			if ($arr2['level'] == 1)
			{
				$arrRet['city'][$arr2['classid']]['name'] = $arr2['city_name'];
			}
			
			if ($arr2['level'] == 2)
			{
				$arrRet['city'][$arr2['parentid']]['pos'][$arr2['classid']] = $arr2['city_name'];
			}
		}
		
		return $arrRet;
		
	}
}